﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="EducationGuide.SettingsFlyouts.signupPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:EducationGuide"
    xmlns:common="using:EducationGuide.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
        <Style x:Key="PasswordBoxStyleApp" TargetType="PasswordBox">
        	<Setter Property="MinWidth" Value="{StaticResource TextControlThemeMinWidth}"/>
        	<Setter Property="MinHeight" Value="{StaticResource TextControlThemeMinHeight}"/>
        	<Setter Property="Foreground" Value="{StaticResource TextBoxForegroundThemeBrush}"/>
        	<Setter Property="Background" Value="{StaticResource TextBoxBackgroundThemeBrush}"/>
        	<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderThemeBrush}"/>
        	<Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}"/>
        	<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
        	<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
        	<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
        	<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
        	<Setter Property="Padding" Value="{StaticResource TextControlThemePadding}"/>
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="PasswordBox">
        				<Grid>
        					<Grid.Resources>
        						<Style x:Name="RevealButtonStyle" TargetType="Button">
        							<Setter Property="Template">
        								<Setter.Value>
        									<ControlTemplate TargetType="Button">
        										<Grid>
        											<VisualStateManager.VisualStateGroups>
        												<VisualStateGroup x:Name="CommonStates">
        													<VisualState x:Name="Normal"/>
        													<VisualState x:Name="PointerOver">
        														<Storyboard>
        															<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
        																<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPointerOverBackgroundThemeBrush}"/>
        															</ObjectAnimationUsingKeyFrames>
        															<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
        																<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPointerOverBorderThemeBrush}"/>
        															</ObjectAnimationUsingKeyFrames>
        															<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
        																<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPointerOverForegroundThemeBrush}"/>
        															</ObjectAnimationUsingKeyFrames>
        														</Storyboard>
        													</VisualState>
        													<VisualState x:Name="Pressed">
        														<Storyboard>
        															<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
        																<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPressedBackgroundThemeBrush}"/>
        															</ObjectAnimationUsingKeyFrames>
        															<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
        																<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPressedBorderThemeBrush}"/>
        															</ObjectAnimationUsingKeyFrames>
        															<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
        																<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPressedForegroundThemeBrush}"/>
        															</ObjectAnimationUsingKeyFrames>
        														</Storyboard>
        													</VisualState>
        													<VisualState x:Name="Disabled">
        														<Storyboard>
        															<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement"/>
        															<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement"/>
        														</Storyboard>
        													</VisualState>
        												</VisualStateGroup>
        											</VisualStateManager.VisualStateGroups>
        											<Border x:Name="BorderElement" BorderBrush="{StaticResource TextBoxButtonBorderThemeBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
        											<Border x:Name="BackgroundElement" Background="{StaticResource TextBoxButtonBackgroundThemeBrush}" Margin="{TemplateBinding BorderThickness}">
        												<TextBlock x:Name="GlyphElement" Foreground="{StaticResource TextBoxButtonForegroundThemeBrush}" FontFamily="{StaticResource SymbolThemeFontFamily}" HorizontalAlignment="Center" Text="&#xE052;" VerticalAlignment="Center"/>
        											</Border>
        										</Grid>
        									</ControlTemplate>
        								</Setter.Value>
        							</Setter>
        						</Style>
        					</Grid.Resources>
        					<Grid.ColumnDefinitions>
        						<ColumnDefinition Width="*"/>
        						<ColumnDefinition Width="Auto"/>
        					</Grid.ColumnDefinitions>
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Disabled">
        								<Storyboard>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
        										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxDisabledForegroundThemeBrush}"/>
        									</ObjectAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Normal">
        								<Storyboard>
        									<DoubleAnimation Duration="0" To="{StaticResource TextControlBackgroundThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement"/>
        									<DoubleAnimation Duration="0" To="{StaticResource TextControlBorderThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="PointerOver">
        								<Storyboard>
        									<DoubleAnimation Duration="0" To="{StaticResource TextControlPointerOverBackgroundThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement"/>
        									<DoubleAnimation Duration="0" To="{StaticResource TextControlPointerOverBorderThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Focused"/>
        						</VisualStateGroup>
        						<VisualStateGroup x:Name="ButtonStates">
        							<VisualState x:Name="ButtonVisible">
        								<Storyboard>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="RevealButton">
        										<DiscreteObjectKeyFrame KeyTime="0">
        											<DiscreteObjectKeyFrame.Value>
        												<Visibility>Visible</Visibility>
        											</DiscreteObjectKeyFrame.Value>
        										</DiscreteObjectKeyFrame>
        									</ObjectAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="ButtonCollapsed"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Border x:Name="BackgroundElement" Grid.ColumnSpan="2" Margin="{TemplateBinding BorderThickness}" Background="#FFFFF6E5"/>
        					<Border x:Name="BorderElement" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" BorderBrush="#FFFFF6E5"/>
        					<ScrollViewer x:Name="ContentElement" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsTabStop="False" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="Disabled" Foreground="#FF808185"/>
        					<Button x:Name="RevealButton" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="1" FontSize="{TemplateBinding FontSize}" IsTabStop="False" Style="{StaticResource RevealButtonStyle}" Visibility="Collapsed" VerticalAlignment="Stretch"/>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}" Background="#FF03AC7E">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="CloseFlyout" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource SnappedBackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Style="{StaticResource SnappedPageHeaderTextStyle}" Text="Login"/>
        </Grid>
        <StackPanel HorizontalAlignment="Left" Margin="60,0,0,0" Grid.RowSpan="2" Width="320">
        	<TextBox TextWrapping="Wrap" Text="Username" Margin="0,160,0,0" Width="226" HorizontalAlignment="Left" Style="{StaticResource TextBoxStyleapp}"/>
        	<PasswordBox Width="226" HorizontalAlignment="Left" Margin="0,35,0,0" Style="{StaticResource PasswordBoxStyleApp}" Password="password"/>
        	<Button Content="forgot password" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="226" Margin="0,10,0,0" Style="{StaticResource BtnForgotPassword}" BorderThickness="0"/>
        	<Button Content="login" HorizontalAlignment="Left" VerticalAlignment="Stretch" Style="{StaticResource BtnStyleApp}" BorderThickness="0" Width="90" Margin="0,15,0,0"/>
        </StackPanel>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
